import createAxios from './axios'

const PROX_PATH = '/api'

// 首页数据展示模块
// 1.某年级在校离校情况(2020-2023),2020为大四
export const getOnLeaveSchool = ({ grade }) => createAxios('get', PROX_PATH + '/man/onLeaveSchool', { grade })
// 2.获取卫生评比成绩
export const queryAllBuildHyg = () => createAxios('get', PROX_PATH + '/man/queryAllBuildHyg')

// 角色管理模块
// 宿管管理
// 1. 获取宿管信息
export const getDomiManagerInfo = ({ currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getHou', { currentPage, pageSize })
// 2.添加宿管
export const addDomiAdminister = ({ houName, houId, password, phone, buildId }) =>
	createAxios('post', PROX_PATH + '/hou/sign', { houName, houId, password, phone, buildId })
// 3.按照宿管id或者宿管名字模糊查询
export const getHouIdName = ({ houId, houName }) =>
	createAxios('get', PROX_PATH + '/man/getHouIdName', { houId, houName })
// 4.删除宿管
export const deleteHouId = ({ houId }) => createAxios('post', PROX_PATH + '/man/deleteHouId', { houId })

// 学生管理
// 1.获取所有学生信息
export const getAllStuInfoByMaster = ({ currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getStu', { currentPage, pageSize })
// 2.管理员删除学生信息
export const deleteStuId=({stuId})=>createAxios("get",PROX_PATH+"/man/deleteStuId",{stuId})

// 3.按照学生id或学生名字模糊查询
export const getStuIdName = ({ stuId, stuName ,buildId}) =>
	createAxios('get', PROX_PATH + '/man/getStuIdName', { stuId, stuName ,buildId})

// 教师管理
// 1.获取所有教师信息
export const getAllTeacherInfo = ({ currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getTea', { currentPage, pageSize })
// 2.添加教师
export const addTeacher = ({ teaName, teaId, password, phone }) =>
	createAxios('post', PROX_PATH + '/tea/sign', { teaName, teaId, password, phone })
// 3.照教师id或者教师名字模糊查询
export const getTeaIdName = ({ teaId, teaName }) =>
	createAxios('get', PROX_PATH + '/man/getTeaIdName', { teaId, teaName })
// 4.删除教师 
export const deleteTeaId=({teaId})=>createAxios("get",PROX_PATH+"/man/deleteTeaId",{teaId})
// 卫生管理模块
// 1.获取所有卫生信息
export const getAllCheckInfo = ({ currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getHygAll', { currentPage, pageSize })
// 2.根据楼栋号进行查询
export const searchByBuildId = ({ currentPage, pageSize, buildId }) =>
	createAxios('get', PROX_PATH + '/man/getHygOne', { currentPage: 1, pageSize: 10, buildId })



// 系统日志模块
// 1.获取所有的日志
export const getAllSysLogs = ({ currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getOpByMan', { currentPage, pageSize })

	
// 公告模块
// 1.获取所有公告信息
export const getAllNoticeByMaster = ({ currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getAllNotice', { currentPage, pageSize })
// 2.根据楼栋查询公告信息
export const searchNoticeByBuildId = ({ buildId, currentPage }) =>
	createAxios('get', PROX_PATH + '/man/getNoticeByMan', { buildId, currentPage })
// 3.删除公搞
export const delNoticeByMan = ({ noticeId }) => createAxios('get', PROX_PATH + '/man/deleteNoticeByMan', { noticeId })
// 4.发布公告
export const addNoticeByMan = ({ buildId, noticeContent }) =>
	createAxios('get', PROX_PATH + '/man/addNoticeByMan', { buildId, noticeContent })
// 5.修改公告
export const updateNoticeByMan = ({ noticeContent, buildId, noticeId }) =>
	createAxios('post', PROX_PATH + '/man/updateNoticeByMan', { noticeContent, buildId, noticeId })

// 公共设施管理
// 1.获取所有的公共设施
export const getAllBuildPublic = ({ currentPage }) =>
	createAxios('get', PROX_PATH + '/man/getAllPublic', { currentPage })
// 2.删除设备
export const deletePublicByMan = ({ publicId }) =>
	createAxios('post', PROX_PATH + '/man/deletePublicByMan', { publicId })
// 3.按名字查询公共设施
export const getPublicName = ({ publicName }) => createAxios('get', PROX_PATH + '/man/getPublicName', { publicName })
// 4.获取某楼栋的某一名称的公共设施情况
export const getPublicOneName = ({ publicName, buildId, currentPage }) =>
	createAxios('get', PROX_PATH + '/man/getPublicOneName', { publicName, buildId, currentPage })
// 5.添加设备
export const addPublicByMan = ({ buildId, publicName, publicCount }) =>
	createAxios('get', PROX_PATH + '/man/addPublicByMan', { buildId, publicName, publicCount })
// 6.修改设备
export const updatePublicByMan = ({ publicId, buildId, publicName, publicCount }) =>
	createAxios('get', PROX_PATH + '/man/updatePublicByMan', { publicId, buildId, publicName, publicCount })

// 假期管理
// 1.获取所有学生假期情况
export const getAllHol = ({ currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getAllHol', { currentPage, pageSize: pageSize })
// 2.查看某楼栋所有的学生假期情况
export const getAllHolBuild = ({ currentPage, buildId }) =>
	createAxios('get', PROX_PATH + '/man/getAllHolBuild', { currentPage, buildId })
// 3.查看某楼栋某寝室的假期情况
export const getHolBuildRoom = ({ buildId, dorNumber }) =>
	createAxios('get', PROX_PATH + '/man/getHolBuildRoom', { buildId, dorNumber })
// 4.管理员查看某个学生的假期情况
export const getHolOneStu = ({ stuId, stuName }) =>
	createAxios('get', PROX_PATH + '/man/getHolOneStu', { stuId, stuName })
// 5.查看所有楼栋在校学生信息
export const getHolOn = ({ currentPage }) => createAxios('get', PROX_PATH + '/man/getHolOn', { currentPage })
// 6.查看所有楼栋离校学生信息
export const getHolLeave = ({ currentPage }) => createAxios('get', PROX_PATH + '/man/getHolLeave', { currentPage })
// 7.查看某楼栋在校学生信息
export const getHolBuildOn = ({ currentPage, buildId }) =>
	createAxios('get', PROX_PATH + '/man/getHolBuildOn', { currentPage, buildId })
// 8.查看某楼栋离校学生信息
export const getHolBuildLeave = ({ currentPage, buildId }) =>
	createAxios('get', PROX_PATH + '/man/getHolBuildLeave', { currentPage, buildId })

// 宿舍管理模块
// 1.查询所有楼栋的宿舍信息
export const getBuildAll = ({ currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getBuildAll', { currentPage, pageSize })
// 2.管理员/宿管获取某楼栋某寝室学生信息
export const getStuOneBuildDor = ({ buildId, dormitory }) =>
	createAxios('get', PROX_PATH + '/public1/getStuOneBuildDor', { buildId, dormitory })
// 3.管理员查询某楼栋的宿舍信息
export const getBuildOne = ({ buildId, currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getBuildOne', { buildId, currentPage, pageSize })
 
// 个人信息模块
export const changeManInfo = ({ password, manName, phone, sex, email }) =>
	createAxios('post', PROX_PATH + '/man/changeManInfo', { password, manName, phone, sex, email })

// 换房申请模块
// 1.管理员查看所有楼栋所有的换房申请
export const getExchangeInfoAll = ({ currentPage, pageSize }) =>
	createAxios('get', PROX_PATH + '/man/getExchangeInfoAll', { currentPage, pageSize })

// 2.管理员查看未审核的换房申请
export const queryExchangeInfoNo = ({ currentPage, status,pageSize }) =>
	createAxios('get', PROX_PATH + '/man/queryExchangeInfoNo', { currentPage, status,pageSize })

